package models

import "xy_api/pkg/model"

type Accounts struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Pwd  string `json:"pwd"`
}

func (Accounts) TableName() string {
	return "account"
}

func AccountLogin(account string) (Accounts, error) {
	var user Accounts
	err := model.DB.Where("account=?", account).Find(&user).Error
	if err != nil {
		return user, err
	}
	return user, nil
}
